              <el-table-column prop="stock" label="库存" width="100">
                <template #default="scope">
                  <span>{{ scope.row.stock }}</span>
                </template>
              </el-table-column>
              
              <el-table-column prop="status" label="状态" width="100">
                <template #default="scope">
                  <el-tag :type="scope.row.status === 1 ? 'success' : 'info'">
                    {{ scope.row.status === 1 ? '上架中' : '已下架' }}
                  </el-tag>
                </template>
              </el-table-column>
              
              <el-table-column label="操作" width="150" fixed="right">
// ... existing code ...

// 获取收藏列表
const loadFavorites = async () => {
  try {
    loading.value = true
    const userId = parseInt(sessionStorage.getItem('userId'))
    const res = await getFavorites(userId)
    
    if (Array.isArray(res)) {
      favorites.value = res.map(item => ({
        id: item.product.productId,
        name: item.product.productName,
        description: item.product.productDescription,
        price: item.product.price,
        stock: item.product.stock,
        images: item.images || [],
        categories: item.categories || [],
        createdAt: item.product.createdAt,
        updatedAt: item.product.updatedAt,
        status: item.product.status  // 添加状态字段
      }))
    } else {
      favorites.value = []
    }
  } catch (error) {
    console.error('获取收藏列表失败:', error)
    ElMessage.error('获取收藏列表失败')
    favorites.value = []
  } finally {
    loading.value = false
  }
} 